package com.util;

import com.Demo.MainInterface;
import com.MyImage.MyImage;
import com.component.FarmingSystemGUI;

import javax.swing.*;
import java.awt.*;
import java.net.URL;

public class GetImage {
    public Image getImage(String path){
        Image img = null;
        try {
            URL url = MyImage.class.getResource(path);
            ImageIcon imageIcon = new ImageIcon(url);
            img = imageIcon.getImage();
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
        return img;
    }

}
